//
//  Header.h
//  Hear
//
//  Created by mac on 2017/3/21.
//  Copyright © 2017年 mac. All rights reserved.
//

#ifndef Header_h
#define Header_h
#define DDLog(xx, ...)  NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

// OSS
#define AccessKey @"LTAI0IBFP4llZabs"
#define SecretKey @"SoP0LaSj9lmf9SSJiNlOHdX8QTPbIw"
#define BucketName @"hear2017"
#define AliYunHost @"oss-cn-shanghai.aliyuncs.com/"

#ifdef DEBUG
#define kTempFolder @"hear_debug_image_ios"
#define kTempSoundFolder @"hear_debug_sound_ios"
#define kTempVideosFolder @"hear_debug_videos_ios"

#else
#define kTempFolder @"hear_image_ios"
#define kTempSoundFolder @"hear_sound_ios"
#define kTempVideosFolder @"hear_videos_ios"

#endif

#define TOKENAPPKEY @"client_dkj39sdJI2rfkIOS"
#define TOKENAPPSECRET @"JKd3i98fgOjdw2o40JodfpJso2389osdHHOw4"

#define NoviecUrl @"http://mp.weixin.qq.com/s/voMqIN9-OvZwavTEu6waVA"

//#define NoviecUrl @"https://mp.weixin.qq.com/s?__biz=MzU0NzAzODg4Ng==&mid=2247484020&idx=1&sn=07809f1fe2f026abd9c7d4924cfb54a7&chksm=fb5531bdcc22b8abe79c5430e2f7c966fa13e7bb78178ec815d6ca20842822ffc96cfc2b0ec6&mpshare=1&scene=1&srcid=0103TrFmSRiN3HKdXSzsItqr&key=1fc49c95154214b5ed07a043ab7995639d164727d52ce34863e9de38529429bae31b62b752d43af6c8f30be3d53f1b44c26cd50f2c11e3fcbc4a6efee3230f9d5fe94ae4f2e1b3c38cfe3731ef28aae3&ascene=0&uin=OTA1MDg2OTE2&devicetype=iMac+Macmini7%2C1+OSX+OSX+10.11.5+build(15F34)&version=12020510&nettype=WIFI&lang=zh_CN&fontScale=100&pass_ticket=Z5sKEEfwOHPhXa7oz4BxTCLO%2F7DVlnE8IwkDBdDDLJRgfHPBVyN6rJldq6b4awhS"

#define ShareHeadUrl @"http://www.dolphinvoice.com"

#define ACCESS_TOKEN [[NSUserDefaults standardUserDefaults] objectForKey:@"access_token"]

#define EXPIRES_IN [[NSUserDefaults standardUserDefaults] objectForKey:@"expires_in"]
#define GETTOKENTIME [[NSUserDefaults standardUserDefaults] objectForKey:@"lastGetTokenTime"]

#define GETTOKENTIME [[NSUserDefaults standardUserDefaults] objectForKey:@"lastGetTokenTime"]

#define GETTOKENTIME [[NSUserDefaults standardUserDefaults] objectForKey:@"lastGetTokenTime"]

#define LONGITUDE [[NSUserDefaults standardUserDefaults] objectForKey:@"longitude"]
#define LATITUDE [[NSUserDefaults standardUserDefaults] objectForKey:@"latitude"]
#define ADDRESS [[NSUserDefaults standardUserDefaults] objectForKey:@"address"]

#define USERINFO [[NSUserDefaults standardUserDefaults] objectForKey:@"userInfo"]
#define USERID [[NSUserDefaults standardUserDefaults] objectForKey:@"userid"]
#define ICONNAME [[NSUserDefaults standardUserDefaults] objectForKey:@"iconName"]
#define ICONCOLOR [[NSUserDefaults standardUserDefaults] objectForKey:@"iconColor"]

#define SEX [[NSUserDefaults standardUserDefaults] objectForKey:@"sex"]
#define NICKNAME [[NSUserDefaults standardUserDefaults] objectForKey:@"nickName"]


#define MOBILE [[NSUserDefaults standardUserDefaults] objectForKey:@"MobileNumber"]

#define USERCOVERPIC [[NSUserDefaults standardUserDefaults] objectForKey:@"UserCoverPicture"]

#define ISOPENTADDRESSBOOK [[NSUserDefaults standardUserDefaults] boolForKey:@"isShowRemendOpenAddressBook"] // 是否提示显示开启通讯录权限

// 显示控制
#define GuidingText [[NSUserDefaults standardUserDefaults] objectForKey:@"GuidingText"]
#define SampleText [[NSUserDefaults standardUserDefaults] objectForKey:@"SampleText"]
#define TipText [[NSUserDefaults standardUserDefaults] objectForKey:@"TipText"]
#define TextBoxTipText [[NSUserDefaults standardUserDefaults] objectForKey:@"TextBoxTipText"]
#define TipTitleText [[NSUserDefaults standardUserDefaults] objectForKey:@"TipTitleText"]


// 小助手头像
#define ADMINICON @"http://hear2017.oss-cn-shanghai.aliyuncs.com/ICON/%E7%BA%A2%E8%89%B2%E6%B5%B7%E8%B1%9A200%E5%83%8F%E7%B4%A0%403x.png"


#define WINDOW [UIApplication sharedApplication].keyWindow

#define CustomUIFont(F) [UIFont systemFontOfSize:F]

#define CustomColor(r, g, b, a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:a]

//十六进制宏定义
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

//#define NavTinColor CustomColor(34, 34, 34, 1)

#define NavTinColor CustomColor(60, 60, 60, 1)


//#define MainColor CustomColor(210, 110, 44, 1)
#define MainColor CustomColor(28, 190, 160, 1)

#define FirstTextColor CustomColor(110, 110, 110, 1)
#define SecondTextColor CustomColor(160, 160, 160, 1)
#define ThirdTextColor CustomColor(34, 34, 34, 1)

#define BlueColor CustomColor(46, 200, 250, 1)

#define VIEWCCONTROLER [[[((HRTabBarViewController *)[[UIApplication sharedApplication].keyWindow rootViewController]) selectedViewController] childViewControllers] lastObject]


// 弱引用
#define WeakSelf __weak typeof(self) weakSelf = self;

#define SCREENWIDTH [[UIScreen mainScreen]bounds].size.width
#define SCREENHEIGHT [[UIScreen mainScreen]bounds].size.height - kTopHeight - kTabBarHeight

#define kFullScreen [UIScreen mainScreen].bounds
#define kFullWidth [UIScreen mainScreen].bounds.size.width
#define kFullHeight [UIScreen mainScreen].bounds.size.height
#define adjuctFloat(x) (x)*kFullWidth/375

#define scaleWidth kFullWidth / 375.0
#define scaleHeight kFullHeight / 667.0

#define kStatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height
#define kNavBarHeight 44.0
#define kTabBarHeight ([[UIApplication sharedApplication] statusBarFrame].size.height>20?83:49)
#define kTopHeight (kStatusBarHeight + kNavBarHeight)
#define kBottomHeight ([[UIApplication sharedApplication] statusBarFrame].size.height>20?34:0)

#define menuViewWith kFullWidth/5*4


#define TEXTCOLOR CustomColor(70, 70, 70, 1)

#define IS_IPHONE_4_OR_LESS (kFullHeight < 568.0)
#define IS_IPHONE_5 (kFullHeight == 568.0)
#define IS_IPHONE_6 (kFullHeight == 667.0)
#define IS_IPHONE_6P (kFullHeight > 667.0)


#ifndef weakify
#if DEBUG
#if __has_feature(objc_arc)
#define weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object;
#else
#define weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object;
#endif
#else
#if __has_feature(objc_arc)
#define weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object;
#else
#define weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object;
#endif
#endif
#endif

#ifndef strongify
#if DEBUG
#if __has_feature(objc_arc)
#define strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object;
#else
#define strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object;
#endif
#else
#if __has_feature(objc_arc)
#define strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object;
#else
#define strongify(object) try{} @finally{} __typeof__(object) object = block##_##object;
#endif
#endif
#endif




#endif /* Header_h */




#if !defined(CG_INLINE)
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#  define CG_INLINE static inline
# elif defined(__cplusplus)
#  define CG_INLINE static inline
# elif defined(__GNUC__)
#  define CG_INLINE static __inline__
# else
#  define CG_INLINE static
# endif
#endif

